username = 'test'
password = 'test123'

count = 0
while count<3:
    u1 = input("请输入用户名:")
    p1 = input("请输入密码:")
    if u1 == username and p1 ==password:
        print("hello %s, welcome to python world!" %username)
        break
    else:
        print("用户名或密码错误!请重新输入")
        count += 1


# 可以试试改用for 循环
